﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Timers;

namespace JumpingMan
{
    class ListofMobs: Mob
    {
        
        Random random = new Random();
        public List<Mob> mobs;
        public ListofMobs(int numberOfMobs)
        {
            mobs = new List<Mob>();            
        }
        public void AddMob()
        {
            int random1 = random.Next(1, 400);
            int random2 = random.Next(1, 400);
            Mob mob = new Mob(random1,random2, 1);
            mobs.Add(mob);
        }
        public void DrawMobs(Graphics imageGraphics)
        {
            Image eurosign = Image.FromFile(@"euro.jpg");
            for(int i = 0; i < mobs.Count; i ++)
            {
                //Rectangle rect = new Rectangle(mob.x, mob.y, 10, 10);
                //imageGraphics.FillRectangle(new SolidBrush(Color.Yellow), rect);
                imageGraphics.DrawImage(eurosign, mobs[i].x, mobs[i].y);
            }
        }
        public void MoveMobs()
        {
            foreach(Mob mob in this.mobs)
            {
                mob.x += mob.direction.X;
                mob.y += mob.direction.Y;
                if (mob.x > 440)
                {
                    mob.x = 440;
                    mob.direction.X *= -1;
                }
                if (mob.x < 0)
                {
                    mob.x = 0;
                    mob.direction.X *= -1;
                }
                if (mob.y > 390)
                {
                    mob.y = 390;
                    mob.direction.Y *= -1;
                }
                if (mob.y < 0)
                {
                    mob.y = 0;
                    mob.direction.Y *= -1;
                }
            }

        }
        public void AddMobWithTime()
        {
            

        }
    
    }
}
